﻿using mozhi.smarterp.Finance.Querys;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;

namespace mozhi.smarterp.Finance.Basedatas.Repository
{
    public interface IBaseDataRepository<TEntity> : IRepository<TEntity, Guid> where TEntity : BaseDataAggregateRootBase
    {
        Task<TEntity> CreateAsync(TEntity data);

        Task<List<TEntity>> FindAsync(PageQuery query);

        Task<TEntity> FindAsync(Guid id);

        Task<int> GetCountAsync(PageQuery query);
    }


    public interface IBaseDataRepository<TEntity , TQuery> : IRepository<TEntity, Guid>
        where TEntity : BaseDataAggregateRootBase
        where TQuery:PageQuery
    {
        Task<TEntity> CreateAsync(TEntity data);

        Task<List<TEntity>> FindAsync(TQuery query);

        Task<TEntity> FindAsync(Guid id);

        Task<int> GetCountAsync(TQuery query);
    }
}
